﻿var a = 0;
var test = 0;
function HieuUng() {
    a += 5;
    document.getElementById('white').style.height = a + 'px';
    if (a == 210) {
        int = window.clearInterval(int)
        test = 0;
        document.getElementById('Login').style.display = 'block';
    }
}

function HieuUngDong() {
    if (a == 0) {
        int = window.clearInterval(int)
        test = 0;
        document.getElementById('white').style.display = 'none';
        document.getElementById('dark').style.display = 'none';
        setLoginValidator(false);
        setForgotValidator(false);
    }
    else {
        a -= 5;
        document.getElementById('white').style.height = a + 'px';
    }
}

function ShowLogin() {
    document.getElementById('white').style.height = 0;
    document.getElementById('white').style.width = 416;
    document.getElementById('Forgot_Validator1').style.display = 'none';
    document.getElementById('Forgot_TextBox1').style.display = 'none';
    document.getElementById('Forgot_Validator2').style.display = 'none';
    document.getElementById('Forgot_TextBox2').style.display = 'none';
    document.getElementById('Forgot_Button').style.display = 'none';
    document.getElementById('white').style.display = 'block';
    document.getElementById('dark').style.display = 'block';
    if (test == 0) {
        int = self.setInterval(HieuUng, 1);
        test = 1;
    }
}

function ShowCP() {
    document.getElementById('white_').style.height = 0;
    a = 0;
    document.getElementById('white_').style.width = 500;
    document.getElementById('white_').style.display = 'block';
    document.getElementById('dark_').style.display = 'block';
    if (test == 0) {
        int = self.setInterval(CPOpen, 1);
        test = 1;
    }
}

function CPOpen() {
    a += 5;
    document.getElementById('white_').style.height = a + 'px';
    if (a == 220) {
        document.getElementById('table_CP').style.display = 'block';
        test = 0;
        int = window.clearInterval(int)
    }
}

function HideCP() {
    document.getElementById('white_').style.height = 220;
    a = 220;
    document.getElementById('white_').style.width = 500;
    document.getElementById('table_CP').style.display = 'none';
    if (test == 0) {
        int = self.setInterval(CPHide, 1);
        test = 1;
    }
}

function CPHide() {
    a -= 5;
    document.getElementById('white_').style.height = a + 'px';
    if (a == 0) {
        document.getElementById('white_').style.display = 'none';
        document.getElementById('dark_').style.display = 'none';
        test = 0;
        int = window.clearInterval(int)
    }
}

function HideLogin() {
    a = 210;
    document.getElementById('white').style.width = 416;
    document.getElementById('Login').style.display = 'none';
    if (test == 0) {
        test == 1;
        int = self.setInterval(HieuUngDong, 1);
    }
}

function setLoginValidator(a) {
    ValidatorEnable(document.getElementById('rfv_id'), a);
    ValidatorEnable(document.getElementById('rfv_pass'), a);
}

function setForgotValidator(a) {
    ValidatorEnable(document.getElementById('rfv_forgot_id'), a);
}

function setCPValidator(a) {
    ValidatorEnable(document.getElementById('rfv_oldpass_'), a);
    ValidatorEnable(document.getElementById('rfv_newpass_'), a);
    ValidatorEnable(document.getElementById('rfv_cfnewpass_'), a);
    ValidatorEnable(document.getElementById('val_cfnewpass_'), a);
}

function ShowForgot() {
    a = 210;
    if (test == 0) {
        test = 1;
        int = self.setInterval(HieuUngForgot, 1);
    }
}

function HieuUngForgot() {
        a += 5;
    document.getElementById('white').style.height = a + 'px';
    if (a == 300) {
        int = window.clearInterval(int)
        test = 0;
        document.getElementById('Forgot_Validator1').style.display = 'table-cell';
        document.getElementById('Forgot_TextBox1').style.display = 'table-cell';
        document.getElementById('Forgot_Validator2').style.display = 'table-cell';
        document.getElementById('Forgot_TextBox2').style.display = 'table-cell';
        document.getElementById('Forgot_Button').style.display = 'table-cell';
    }
}